package com.kly.user.eventbus;

/**
 * 事件类型
 * @author linqu
 */
public enum ActionEnum {

    LOG(1, "LOG", "记录日志"),
    PUSH_MSG(2, "PUSH", "发送消息"),
    STORE_PRE_HOME_DATA(3, "STORE_PRE_HOME_DATA", "缓存首页预加载数据"),
    STORE_MSG_DATA(4, "STORE_MSG_DATA", "用户发送消息数量"),
    ;

    private final int type;

    private final String Value;

    private final String description;


    ActionEnum(int type, String value, String description) {
        this.type = type;
        Value = value;
        this.description = description;
    }

    public int getType() {
        return type;
    }

    public String getValue() {
        return Value;
    }

    public String getDescription() {
        return description;
    }


    public static ActionEnum fromType(int type) {
        for (ActionEnum userStatus : values()) {
            if (userStatus.getType() == type) {
                return userStatus;
            }
        }
        throw new IllegalArgumentException("Invalid login type: " + type);
    }
}
